package libraries;

import java.util.LinkedList;

public class TransConn{

	private LinkedList<String> keys;
	private LinkedList<String> values;
	
	public TransConn() {
		super();
		this.keys = new LinkedList<String>();
		this.values = new LinkedList<String>();
	}
	
	public void put(String key, String value) {
		this.keys.add(key);
		this.values.add(value);
	}
	
	public String get(String key) {
		for (int i = 0; i < this.keys.size(); i++) {
			if (this.keys.get(i).equals(key)) {
				return this.values.get(i);
			}
		}
		return "Unknown_Connector";
	}

	public TransConn(LinkedList<String> keys, LinkedList<String> values) {
		super();
		this.keys = keys;
		this.values = values;
	}
	
	public String toString() {
		String result = "Connectors: ";
		for (int i = 0; i < keys.size(); i++) {
			result += keys.get(i) + " - " + values.get(i) + ", ";
		}
		return result;
	}
	
	public String toFileString() {
		String result = "";
		for (int i = 0; i < keys.size(); i++) {
			result += keys.get(i) + " " + values.get(i) + "|";
		}
		result = result.substring(0, result.length()-1);
		result += "\n";
		return result;
	}
}
